﻿namespace etracks.Helpers.Tests
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using NUnit.Framework;
    using System.Data.Common;
    using System.Data;

    [TestFixture]
    public class PostgresHelperTest
    {

        [Test]
        public void Get_Connection_Test()
        {
            IDatabaseHelper dbHelper = DatabaseHelperFactory.Get(DatabaseType.POSTGRESQL);
            dbHelper.ConnectionString = ConfigHelper.GetConnectionString("postgresql");
            dbHelper.Connection.Open();
            Assert.AreEqual(System.Data.ConnectionState.Open, dbHelper.Connection.State);
            dbHelper.Connection.Close();
        }

        [Test]
        public void Get_Command_Test()
        {
            throw new NotImplementedException();
        }

        [Test]
        public void Get_DataSet_Test()
        {
            IDatabaseHelper dbHelper = DatabaseHelperFactory.Get(DatabaseType.POSTGRESQL);
            dbHelper.ConnectionString = ConfigHelper.GetConnectionString("postgresql");
            List<DbParameter> pl = new List<DbParameter>();
            pl.Add(dbHelper.GetParameter("name", "Judy"));
            DataSet ds = dbHelper.GetDataSet("get_student", pl);
        }

        [Test]
        public void Get_DataReader_Test()
        {
            throw new NotImplementedException();
        }

    } // public class PostgresHelperTest

} // namespace etracks.Helpers.Tests